package starter;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class DataConnection {
	
	public String url = "jdbc:mysql://martcor.nl:3306/deb42181_prom";
	public String user = "deb42181_prom";
	public String password = "Vgj7KtOj";

	public Connection conn =null;
	public Statement stmt = null;
	public ResultSet rs = null;
	public Boolean del = null;
	public Boolean ins = null;
	public PreparedStatement pst = null;
	
	// Method for closing the database connection
		public void closeConn(){
			try {
				conn.close();			
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		// Method for opening a database connection.
		public void openConn(){
			try{
				//sClass.forName("com.mysql.jdbc.Driver").newInstance();
				conn = DriverManager.getConnection(url, user, password);

			}
			catch(SQLException err){
				System.out.println(err.getMessage());

			}
		}

}
